package com.yupi.oj.judge.codesanbox.impl;

import com.yupi.oj.judge.codesanbox.CodeSanBox;
import com.yupi.oj.judge.codesanbox.model.ExecuteCodeRequest;
import com.yupi.oj.judge.codesanbox.model.ExecuteCodeResponse;
import com.yupi.oj.model.dto.questionsubmit.JudgeInfo;
import com.yupi.oj.model.enums.QuestionSubmitStatusEnum;

import java.util.List;

public class ExampleCodeSanBox implements CodeSanBox {
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> input = executeCodeRequest.getInput();

        // 模拟执行代码
        ExecuteCodeResponse executeCodeResponse = ExecuteCodeResponse.builder()
                .output(input)
                .status(QuestionSubmitStatusEnum.SUCCESS.getValue())
                .message("执行成功")
                .judgeInfo(new JudgeInfo("执行成功", 100L, 100L))
                .build();
        return executeCodeResponse;
    }
}
